from rest_framework.routers import SimpleRouter
from . import views


# 创建一个路由管理对象
# trailing_slash是否要在生成的路由尾部添加/
router = SimpleRouter(trailing_slash=False)


# 注册查询任务视图集
router.register(r'task', views.SelectTask, basename='task')
router.register(r'condition', views.ConditionViewSet, basename='condition')  # 新增
# 保存提交的代码
router.register(r'save_code', views.SaveCodeViewSet, basename='save_code')
# 开始，已完成路由
router.register(r'change_task', views.StartEndTaskViewSet, basename='change_task')

router.register('task_cent', views.TaskViewSet, basename='task_cent')

# 教师端检查按钮路由
router.register('teacher_check_button', views.TeacherCheckButtonViewSet, basename='teacher_check_button')

# 教师查询任务视图集
# router.register('teacher_select_task', views.TeacherSelectTaskViewSet, basename='teacher_select_task')

# 教师分配任务
# urlpatterns = [
#     path('assign_task', AssignTaskView.as_view(), name='assign_task'),
# ]
router.register('assign_task', views.AssignTaskViewSet, basename='assign_task')